package zuoye2;

class CPU {
	int speed;
	public CPU() {
	}
	public int getSpeed() {
		return speed;
	}
	public void setSpeed(int m) {
		this.speed = m;
	}
}

class HardDisk {
	int amount;
	public HardDisk() {
	}
	public int getAmount() {
		return amount;
	}
	public void setAmount(int m) {
		this.amount = m;
	}
}

class PC {
	CPU cpu;
	HardDisk HD;
	public PC() {
	}
	public void setCPU(CPU c) {
		this.cpu = c;
	}
	public void setHardDisk(HardDisk h) {
		this.HD = h;
	}
	public void show() {
		System.out.println("CPU的速度为："+ cpu.getSpeed());
		System.out.println("硬盘的容量为："+ HD.getAmount());
	}
}

public class Test {
	public static void main(String args[]) {
		PC pc = new PC();
		
		CPU cpu = new CPU();
		cpu.setSpeed(2200);
		pc.setCPU(cpu);
		
		HardDisk disk = new HardDisk();
		disk.setAmount(200);
		pc.setHardDisk(disk);
		
		pc.show();
	}
}